<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			.content{
				width: 500px;
				height: 500px;
				margin: 30px auto;
				background-color: burlywood;
			}
		</style>
	</head>
	<body>
		<div class="content">
			<h1>哈哈</h1>
		</div>
	</body>
	<script type="text/javascript">
//		获取元素
		var content = document.querySelector(".content");
//		创建元素
		var box = document.createElement("div");
		box.style.width = "200px";
		box.style.height = "200px";
		box.style.backgroundColor = "red";
		console.log(box);
//		添加元素
		content.appendChild(box);
		
		
	</script>
</html>
